/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-03 14:14:47  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import com.joysuch.wwyt.mh.entity.MhMajorHazard;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_BP_STORAGE_TANK")
@SQLDelete(sql = "update WWYT_BP_STORAGE_TANK set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BP_STORAGE_TANK set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpStorageTank implements java.io.Serializable {

    // columns START
    // ID
    private Long id;
    // 统一编码
    private String uniCode;
    // 储罐名称
    private String name;
    // 所属罐组编号
    private String belongGroupCode;
    // 储罐编号
    private String code;
    // 储罐容积(m3)
    private Float volume;
    // 储罐形式
    private String type;
    // 储罐结构
    private String arch;
    // 储罐材质
    private String material;
    // 储罐位置分类
    private String locationCategory;
    // 是否为压力容器
    private String isPressureContainer;
    // 压力等级
    private String pressureLevel;
    // 是否高危储罐
    private String isDangerousTank;
    // 是否设置自动喷淋
    private String isSetAutomaticSpray;
    // 是否构成高危储罐
    private String isFormDangerousTank;
    // 有无围堰
    private String hasCofferdam;
    // 围堰所围面积(㎡)
    private Float cofferdamArea;
    // 进出料方式
    private String inOutMethod;
    // 安全设备
    private String safeDevice;
    // 是否配套火炬
    private String isProvideTorch;
    // 是否设置保温/保冷
    private String isProvideHeatPreservation;
    // 是否设置消防水炮/泡沫炮
    private String isProvideFireWaterMonitor;
    // 投产日期
    private java.util.Date commissioningDate;
    // 设计储量(m3)
    private Float designStorageVolume;
    // 设计压力(Pa)
    private Float designPressure;
    // 操作压力上限(Pa)
    private Float opPressureHighValue;
    // 操作压力下限(Pa)
    private Float opPressureLowValue;
    // 操作温度上限(℃)
    private Float opTemperatureHighValue;
    // 操作温度下限(℃)
    private Float opTemperatureLowValue;
    // 工作温度上限(℃)
    private Float workTemperatureHighValue;
    // 工作温度下限(℃)
    private Float workTemperatureLowValue;
    // 工作压力上限(Pa)
    private Float workPressureHighValue;
    // 工作压力下限(Pa)
    private Float workPressureLowValue;
    // 设计液位高度(m)
    private Float designLiquidLevel;
    // 液位计类型
    private String liquidometerType;
    // 高液位报警(m)
    private Float liquidLevelAlarmHigh1;
    // 高高液位报警(m)
    private Float liquidLevelAlarmHigh2;
    // 低液位报警(m)
    private Float liquidLevelAlarmLow1;
    // 底底液位报警(m)
    private Float liquidLevelAlarmLow2;
    // 所在位置
    private String location;
    // 高危储罐自控系统
    private String dangerousControlSystem;
    // 是否构成重大危险源
    private String isFormMajorHazard;
    // 创建人
    private Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private String deleteFlag;
    // 组织机构代码
    private String orgCode;
    // 租户
    private Long tenentId;
    // columns END

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "UNI_CODE", length = 20)
    public String getUniCode() {
        return this.uniCode;
    }

    public void setUniCode(String value) {
        this.uniCode = value;
    }

    @Column(name = "NAME", length = 30)
    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    @Column(name = "BELONG_GROUP_CODE", length = 20)
    public String getBelongGroupCode() {
        return this.belongGroupCode;
    }

    public void setBelongGroupCode(String value) {
        this.belongGroupCode = value;
    }

    @Column(name = "CODE", length = 10)
    public String getCode() {
        return this.code;
    }

    public void setCode(String value) {
        this.code = value;
    }

    @Column(name = "VOLUME")
    public Float getVolume() {
        return this.volume;
    }

    public void setVolume(Float value) {
        this.volume = value;
    }

    @Column(name = "TYPE", length = 20)
    public String getType() {
        return this.type;
    }

    public void setType(String value) {
        this.type = value;
    }

    @Column(name = "ARCH", length = 30)
    public String getArch() {
        return this.arch;
    }

    public void setArch(String value) {
        this.arch = value;
    }

    @Column(name = "MATERIAL", length = 30)
    public String getMaterial() {
        return this.material;
    }

    public void setMaterial(String value) {
        this.material = value;
    }

    @Column(name = "LOCATION_CATEGORY", length = 30)
    public String getLocationCategory() {
        return this.locationCategory;
    }

    public void setLocationCategory(String value) {
        this.locationCategory = value;
    }

    @Column(name = "IS_PRESSURE_CONTAINER", length = 2)
    public String getIsPressureContainer() {
        return this.isPressureContainer;
    }

    public void setIsPressureContainer(String value) {
        this.isPressureContainer = value;
    }

    @Column(name = "PRESSURE_LEVEL", length = 30)
    public String getPressureLevel() {
        return this.pressureLevel;
    }

    public void setPressureLevel(String value) {
        this.pressureLevel = value;
    }

    @Column(name = "IS_DANGEROUS_TANK", length = 2)
    public String getIsDangerousTank() {
        return this.isDangerousTank;
    }

    public void setIsDangerousTank(String value) {
        this.isDangerousTank = value;
    }

    @Column(name = "IS_SET_AUTOMATIC_SPRAY", length = 2)
    public String getIsSetAutomaticSpray() {
        return this.isSetAutomaticSpray;
    }

    public void setIsSetAutomaticSpray(String value) {
        this.isSetAutomaticSpray = value;
    }

    @Column(name = "IS_FORM_DANGEROUS_TANK", length = 2)
    public String getIsFormDangerousTank() {
        return this.isFormDangerousTank;
    }

    public void setIsFormDangerousTank(String value) {
        this.isFormDangerousTank = value;
    }

    @Column(name = "HAS_COFFERDAM", length = 2)
    public String getHasCofferdam() {
        return this.hasCofferdam;
    }

    public void setHasCofferdam(String value) {
        this.hasCofferdam = value;
    }

    @Column(name = "COFFERDAM_AREA")
    public Float getCofferdamArea() {
        return this.cofferdamArea;
    }

    public void setCofferdamArea(Float value) {
        this.cofferdamArea = value;
    }

    @Column(name = "IN_OUT_METHOD", length = 100)
    public String getInOutMethod() {
        return this.inOutMethod;
    }

    public void setInOutMethod(String value) {
        this.inOutMethod = value;
    }

    @Column(name = "SAFE_DEVICE", length = 50)
    public String getSafeDevice() {
        return this.safeDevice;
    }

    public void setSafeDevice(String value) {
        this.safeDevice = value;
    }

    @Column(name = "IS_PROVIDE_TORCH", length = 2)
    public String getIsProvideTorch() {
        return this.isProvideTorch;
    }

    public void setIsProvideTorch(String value) {
        this.isProvideTorch = value;
    }

    @Column(name = "IS_PROVIDE_HEAT_PRESERVATION", length = 2)
    public String getIsProvideHeatPreservation() {
        return this.isProvideHeatPreservation;
    }

    public void setIsProvideHeatPreservation(String value) {
        this.isProvideHeatPreservation = value;
    }

    @Column(name = "IS_PROVIDE_FIRE_WATER_MONITOR", length = 2)
    public String getIsProvideFireWaterMonitor() {
        return this.isProvideFireWaterMonitor;
    }

    public void setIsProvideFireWaterMonitor(String value) {
        this.isProvideFireWaterMonitor = value;
    }

    @Column(name = "COMMISSIONING_DATE")
    public java.util.Date getCommissioningDate() {
        return this.commissioningDate;
    }

    public void setCommissioningDate(java.util.Date value) {
        this.commissioningDate = value;
    }

    @Column(name = "DESIGN_STORAGE_VOLUME")
    public Float getDesignStorageVolume() {
        return this.designStorageVolume;
    }

    public void setDesignStorageVolume(Float value) {
        this.designStorageVolume = value;
    }

    @Column(name = "DESIGN_PRESSURE")
    public Float getDesignPressure() {
        return this.designPressure;
    }

    public void setDesignPressure(Float value) {
        this.designPressure = value;
    }

    @Column(name = "OP_PRESSURE_HIGH_VALUE")
    public Float getOpPressureHighValue() {
        return this.opPressureHighValue;
    }

    public void setOpPressureHighValue(Float value) {
        this.opPressureHighValue = value;
    }

    @Column(name = "OP_PRESSURE_LOW_VALUE")
    public Float getOpPressureLowValue() {
        return this.opPressureLowValue;
    }

    public void setOpPressureLowValue(Float value) {
        this.opPressureLowValue = value;
    }

    @Column(name = "OP_TEMPERATURE_HIGH_VALUE")
    public Float getOpTemperatureHighValue() {
        return this.opTemperatureHighValue;
    }

    public void setOpTemperatureHighValue(Float value) {
        this.opTemperatureHighValue = value;
    }

    @Column(name = "OP_TEMPERATURE_LOW_VALUE")
    public Float getOpTemperatureLowValue() {
        return this.opTemperatureLowValue;
    }

    public void setOpTemperatureLowValue(Float value) {
        this.opTemperatureLowValue = value;
    }

    @Column(name = "WORK_TEMPERATURE_HIGH_VALUE")
    public Float getWorkTemperatureHighValue() {
        return this.workTemperatureHighValue;
    }

    public void setWorkTemperatureHighValue(Float value) {
        this.workTemperatureHighValue = value;
    }

    @Column(name = "WORK_TEMPERATURE_LOW_VALUE")
    public Float getWorkTemperatureLowValue() {
        return this.workTemperatureLowValue;
    }

    public void setWorkTemperatureLowValue(Float value) {
        this.workTemperatureLowValue = value;
    }

    @Column(name = "WORK_PRESSURE_HIGH_VALUE")
    public Float getWorkPressureHighValue() {
        return this.workPressureHighValue;
    }

    public void setWorkPressureHighValue(Float value) {
        this.workPressureHighValue = value;
    }

    @Column(name = "WORK_PRESSURE_LOW_VALUE")
    public Float getWorkPressureLowValue() {
        return this.workPressureLowValue;
    }

    public void setWorkPressureLowValue(Float value) {
        this.workPressureLowValue = value;
    }

    @Column(name = "DESIGN_LIQUID_LEVEL")
    public Float getDesignLiquidLevel() {
        return this.designLiquidLevel;
    }

    public void setDesignLiquidLevel(Float value) {
        this.designLiquidLevel = value;
    }

    @Column(name = "LIQUIDOMETER_TYPE", length = 50)
    public String getLiquidometerType() {
        return this.liquidometerType;
    }

    public void setLiquidometerType(String value) {
        this.liquidometerType = value;
    }

    @Column(name = "LIQUID_LEVEL_ALARM_HIGH1")
    public Float getLiquidLevelAlarmHigh1() {
        return this.liquidLevelAlarmHigh1;
    }

    public void setLiquidLevelAlarmHigh1(Float value) {
        this.liquidLevelAlarmHigh1 = value;
    }

    @Column(name = "LIQUID_LEVEL_ALARM_HIGH2")
    public Float getLiquidLevelAlarmHigh2() {
        return this.liquidLevelAlarmHigh2;
    }

    public void setLiquidLevelAlarmHigh2(Float value) {
        this.liquidLevelAlarmHigh2 = value;
    }

    @Column(name = "LIQUID_LEVEL_ALARM_LOW1")
    public Float getLiquidLevelAlarmLow1() {
        return this.liquidLevelAlarmLow1;
    }

    public void setLiquidLevelAlarmLow1(Float value) {
        this.liquidLevelAlarmLow1 = value;
    }

    @Column(name = "LIQUID_LEVEL_ALARM_LOW2")
    public Float getLiquidLevelAlarmLow2() {
        return this.liquidLevelAlarmLow2;
    }

    public void setLiquidLevelAlarmLow2(Float value) {
        this.liquidLevelAlarmLow2 = value;
    }

    @Column(name = "LOCATION", length = 200)
    public String getLocation() {
        return this.location;
    }

    public void setLocation(String value) {
        this.location = value;
    }

    @Column(name = "DANGEROUS_CONTROL_SYSTEM", length = 100)
    public String getDangerousControlSystem() {
        return this.dangerousControlSystem;
    }

    public void setDangerousControlSystem(String value) {
        this.dangerousControlSystem = value;
    }

    @Column(name = "IS_FORM_MAJOR_HAZARD", length = 2)
    public String getIsFormMajorHazard() {
        return this.isFormMajorHazard;
    }

    public void setIsFormMajorHazard(String value) {
        this.isFormMajorHazard = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    private Long bpStorageTankArea;

    // @ManyToOne(fetch=FetchType.EAGER,cascade={CascadeType.PERSIST,CascadeType.REMOVE})
    // @JoinColumn(name="STORAGE_TANK_AREA_ID")
    @Column(name = "STORAGE_TANK_AREA_ID")
    public Long getBpStorageTankArea() {
        return this.bpStorageTankArea;
    }

    public void setBpStorageTankArea(Long bpStorageTankArea) {
        this.bpStorageTankArea = bpStorageTankArea;
    }

    @JsonIgnore
    private MhMajorHazard mhMajorHazard;

    @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST })
    @JoinColumn(name = "MAJOR_HAZARD_ID")
    public MhMajorHazard getMhMajorHazard() {
        return this.mhMajorHazard;
    }

    public void setMhMajorHazard(MhMajorHazard mhMajorHazard) {
        this.mhMajorHazard = mhMajorHazard;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("uniCode", getUniCode()).append("name", getName())
                .append("belongGroupCode", getBelongGroupCode()).append("code", getCode()).append("volume", getVolume())
                .append("type", getType()).append("arch", getArch()).append("material", getMaterial())
                .append("locationCategory", getLocationCategory())
                .append("isPressureContainer", getIsPressureContainer()).append("pressureLevel", getPressureLevel())
                .append("isDangerousTank", getIsDangerousTank()).append("isSetAutomaticSpray", getIsSetAutomaticSpray())
                .append("isFormDangerousTank", getIsFormDangerousTank()).append("hasCofferdam", getHasCofferdam())
                .append("cofferdamArea", getCofferdamArea()).append("inOutMethod", getInOutMethod())
                .append("safeDevice", getSafeDevice()).append("isProvideTorch", getIsProvideTorch())
                .append("isProvideHeatPreservation", getIsProvideHeatPreservation())
                .append("isProvideFireWaterMonitor", getIsProvideFireWaterMonitor())
                .append("commissioningDate", getCommissioningDate())
                .append("designStorageVolume", getDesignStorageVolume()).append("designPressure", getDesignPressure())
                .append("opPressureHighValue", getOpPressureHighValue())
                .append("opPressureLowValue", getOpPressureLowValue())
                .append("opTemperatureHighValue", getOpTemperatureHighValue())
                .append("opTemperatureLowValue", getOpTemperatureLowValue())
                .append("workTemperatureHighValue", getWorkTemperatureHighValue())
                .append("workTemperatureLowValue", getWorkTemperatureLowValue())
                .append("workPressureHighValue", getWorkPressureHighValue())
                .append("workPressureLowValue", getWorkPressureLowValue())
                .append("designLiquidLevel", getDesignLiquidLevel()).append("liquidometerType", getLiquidometerType())
                .append("liquidLevelAlarmHigh1", getLiquidLevelAlarmHigh1())
                .append("liquidLevelAlarmHigh2", getLiquidLevelAlarmHigh2())
                .append("liquidLevelAlarmLow1", getLiquidLevelAlarmLow1())
                .append("liquidLevelAlarmLow2", getLiquidLevelAlarmLow2()).append("location", getLocation())
                .append("dangerousControlSystem", getDangerousControlSystem())
                .append("isFormMajorHazard", getIsFormMajorHazard()).append("createBy", getCreateBy())
                .append("createTime", getCreateTime()).append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime()).append("deleteFlag", getDeleteFlag())
                .append("orgCode", getOrgCode()).append("tenentId", getTenentId()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpStorageTank == false)
            return false;
        if (this == obj)
            return true;
        BpStorageTank other = (BpStorageTank) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
